# -*- coding:utf-8 -*-
'''
@Author: lindes
'''

import xadmin
from xadmin import views
from users.models import VerifyCode, UserProfile, Focus, Feedback


class BaseSetting:
    enable_themes = True
    use_bootswatch = True


class GlobalSettings:
    site_title = "篮球社区后台"
    site_footer = "Basketball Community"
    menu_style = "accordion"


class VerifyCodeAdmin:
    list_display = ['code', 'email', "add_time"]


class UserProfileAdmin:

    list_display = ['name', 'email', 'type', 'gender', 'age', 'photo', 'add_time']
    list_filter = ['age', 'gender']
    search_fields = ['name', 'email']


class FocusAdmin:
    list_display = ['user_id_a', 'user_id_b', 'add_time']


class FeedbackAdmin:
    list_display = ['author', 'title', 'add_time', 'is_deal', 'deal_time']
    list_filter = ['title', 'add_time', 'is_deal']
    search_fields = ['title']


xadmin.site.register(VerifyCode, VerifyCodeAdmin)
xadmin.site.register(UserProfile, UserProfileAdmin)
xadmin.site.register(Feedback, FeedbackAdmin)
xadmin.site.register(Focus, FocusAdmin)
xadmin.site.register(views.BaseAdminView, BaseSetting)
xadmin.site.register(views.CommAdminView, GlobalSettings)
